<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        #d1 {
            width: 700px;
            height: 400px;
            /* 水平居中对齐 */
            margin: auto;
            /* 距离顶部100px */
            margin-top: 100px
        }
    </style>

</head>
<body>

<div id="d1">
    <img id="img1" src="img/1.jpeg" alt="" width="100%" height="100%">
</div>
</body>
<script>
    let arr = ["img/1.jpeg","img/3.jpeg","img/5.jpeg"];
    let b=document.getElementById("img1")
    let i=0;
    function time(){
        i++;
        i=(i++)%arr.length;
        b.src=arr[i];
    }
    let a=setInterval(time,1000);





</script>
</html>